//
//  SLPerson.m
//  Objective-C
//
//  Created by S_Line on 2018/5/8.
//  Copyright © 2018年 S_Line. All rights reserved.
//

#import "SLPerson.h"

@implementation SLPerson

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if ([super init]) {
        self.age = [aDecoder decodeIntForKey:@"age"];
        self.height = [aDecoder decodeObjectForKey:@"height"];
        self.weight = [aDecoder decodeObjectForKey:@"weight"];
        self.name = [aDecoder decodeObjectForKey:@"name"];
    }
    return self;
}


- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeInt:self.age forKey:@"age"];
    [aCoder encodeObject:self.height forKey:@"height"];
    [aCoder encodeObject:self.weight forKey:@"weight"];
    [aCoder encodeObject:self.name forKey:@"name"];
}

@end
